import hashlib
from bug任务平台.settings import SECRET_KEY
import uuid


def md5(s: str) -> str:
    h = hashlib.md5(SECRET_KEY.encode('utf-8'))
    h.update(s.encode('utf-8'))
    return h.hexdigest()


def uid(string: str) -> str:
    data = f'{str(uuid.uuid4())}-{string}'
    return md5(data)
